package migrate

import (
	"gorm.io/gorm"
	"shop-api/databases/mysql"
	"shop-api/internal/model"
)

func Migrate() error {
	return mysql.WithClient(func(db *gorm.DB) error {
		return db.AutoMigrate(
			model.User{},
			model.Good{},
			model.GoodAttribute{},
			model.GoodAttributeValue{},
			model.GoodSKU{},
			model.GoodSKUAttributeValue{},
			model.GoodType{},
		)
	})
}
